package com.itheima.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

	@RequestMapping("/add")
	@PreAuthorize("hasAnyAuthority('add')")
	public String add(){
		System.out.println("添加操作");
		return  "add";
	}

	@RequestMapping("/delete")
	@PreAuthorize("hasAnyAuthority('delete')")
	public String delete(){
		System.out.println("删除操作");
		return  "delete";
	}

	@RequestMapping("/update")
	@PreAuthorize("hasAnyAuthority('update')")
	public String update(){
		System.out.println("修改操作");
		return  "update";
	}

	@RequestMapping("/find")
	@PreAuthorize("hasAnyAuthority('find')")
	public String find(){
		System.out.println("查询操作");
		return  "find";
	}

}
